/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.contract.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.pig4cloud.pigx.contract.annotation.SetScaleMainCurrency;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 成交记录表
 *
 * @date 2022-08-18 09:40:29
 */
@Data
@TableName("ripple_contract_trade")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "成交记录表")
public class ContractTrade extends Model<ContractTrade> {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键")
	private Long id;

	/**
	 * 用户id
	 */
	@ApiModelProperty(value = "用户id")
	private Long userId;

	/**
	 * 币对id
	 */
	@ApiModelProperty(value = "币对id")
	private Long symbolId;

	/**
	 * 币对名称
	 */
	@ApiModelProperty(value = "币对名称")
	private String symbolName;

	/**
	 * 订单id
	 */
	@ApiModelProperty(value = "订单id")
	private Long orderId;

	/**
	 * 订单类型（0市价单、1限价单、2强平单）
	 */
	@ApiModelProperty(value = "订单类型（0市价单、1限价单、2强平单）")
	private String orderType;

	/**
	 * 对手盘用户id
	 */
	@ApiModelProperty(value = "对手盘用户id")
	private Long makerUserId;

	/**
	 * 对手盘订单id
	 */
	@ApiModelProperty(value = "对手盘订单id")
	private Long makerOrderId;

	/**
	 * 对手盘成交记录id
	 */
	@ApiModelProperty(value = "对手盘成交记录id")
	private Long makerTradeId;

	/**
	 * 仓位id
	 */
	@ApiModelProperty(value = "仓位id")
	private Long positionId;

	/**
	 * 是否是买单（0否，是卖单、1是买单）
	 */
	@ApiModelProperty(value = "是否是买单（0否，是卖单、1是买单）")
	private String isBuy;

	/**
	 * 是否机器人（0否、1是）
	 */
	@ApiModelProperty(value = "是否机器人（0否、1是）")
	private String isRobot;

	/**
	 * 订单方向（0做多、1做空）
	 */
	@ApiModelProperty(value = "订单方向（0做多、1做空）")
	private String side;

	/**
	 * 操作类型（0开仓、1平仓）
	 */
	@ApiModelProperty(value = "操作类型（0开仓、1平仓）")
	private String operationType;

	/**
	 * 成交价格
	 */
	@ApiModelProperty(value = "成交价格")
	private BigDecimal price;

	/**
	 * 成交数量
	 */
	@ApiModelProperty(value = "成交数量")
	private BigDecimal num;

	/**
	 * 交易面值
	 */
	@ApiModelProperty(value = "交易面值")
	private BigDecimal tradeValue;

	/**
	 * 倍数
	 */
	@ApiModelProperty(value = "倍数")
	private Integer multiple;

	/**
	 * 手续费
	 */
	@SetScaleMainCurrency
	@ApiModelProperty(value = "手续费")
	private BigDecimal handlingFee;

	/**
	 * 手续费率
	 */
	@ApiModelProperty(value = "手续费率")
	private BigDecimal handlingFeeRate;

	/**
	 * 保证金
	 */
	@ApiModelProperty(value = "保证金")
	private BigDecimal margin;

	/**
	 * 收益，平仓时有值
	 */
	@ApiModelProperty(value = "收益，平仓时有值")
	private BigDecimal profit;

	/**
	 * 强平清算费
	 */
	@ApiModelProperty(value = "强平清算费")
	private BigDecimal liquidateFee;

	/**
	 * 强平清算费率
	 */
	@ApiModelProperty(value = "强平清算费率")
	private BigDecimal liquidateFeeRate;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 创建人
	 */
	@ApiModelProperty(value = "创建人")
	private Long createBy;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * 修改人
	 */
	@ApiModelProperty(value = "修改人")
	private Long updateBy;

	/**
	 * 状态（暂无作用）
	 */
	@ApiModelProperty(value = "状态（暂无作用）")
	private String status;

	/**
	 * 是否删除（null是、0否）
	 */
	@ApiModelProperty(value = "是否删除（null是、0否）")
	private String isDeleted;

}
